Encoded video streams can be modified at a midpoint to include new content. For example, an advertisement insertion device can splice an advertisement into a designated portion of an encoded video stream. Numerous factors can affect whether a decoder, such as a television, displays undesired video artifacts attributable to the splicing.
For example, depending on where reference frames used for decoding were positioned in the encoded stream during the encoding, the splicing can cause macro-blocking to be displayed upon decoding. Also, indications inserted by the encoder to define the portion of the encoded video designated for mid-point replacement can be inaccurate. This inaccuracy can result in the spliced advertisement replacing a portion of program content or result in other problems observable upon decoding. The disclosure that follows solves these and other problems.